package com.wn.mappper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wn.bean.Book;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface BookMapper extends BaseMapper<Book> {

    @Select("SELECT * FROM t_book WHERE MOD(id,#{shardTotal})=#{shardIndex}")
    List<Book> findData(
            @Param("shardTotal") int shardTotal,
            @Param("shardIndex") int shardIndex);
}